GetLength

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Returns the number of values in a JSONArray.

Syntax

GetLength()

Supported objects

JSONArray

Return value

Value Description
Value Number of values in the JSONArray.

Example

jsonArray = JSONNewArray()

' Appends 1 and 2 to end of array

jsonArray.Push(1)

jsonArray.Push(2)

' Appends 3 to end of array

jsonArray.SetValue(2, 3)

' Sets first index in array to -1

jsonArray.SetValue(0, -1)

' Returns 3

intVal = jsonArray.GetLength()

PrintLn("Should be 3: " & intVal)